Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Regex benchmarks #11504

Merged
merged 8 commits into from
Nov 12, 2024
Merged

Create Regex benchmarks #11504

merged 8 commits into from
Nov 12, 2024

Conversation

GregoryTravis
Copy link
Contributor

Includes benchmarks verifying regex and replacer compilation memoization.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@GregoryTravis GregoryTravis marked this pull request as ready for review November 6, 2024 20:31
@GregoryTravis GregoryTravis added the CI: No changelog needed Do not require a changelog entry for this PR. label Nov 6, 2024
@GregoryTravis
Copy link
Contributor Author

New PR since I did something unfixable to the old one's branch.

create =
faker = Faker.new
a_regex = Regex.compile "(\d)ab(\d)"
Data.Value (build_two_nums faker) (build_just_two_nums faker) (build_four_nums faker) a_regex (build_regexes faker) (build_replacers faker) (Regex.compile "(\d+)") (Regex.compile "(\d+)[a-z]+(\d+)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this line be split into multiple ones? As

Each argument in a type-constructor definition may be specified on its own (indented) line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a constructor invocation, not a definition -- should that also work? When I moved the arguments to multiple lines, I got syntax errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from Standard.Base import all

type X
   Y
      a
      b

main = X.Y
    <| 1 
    <| 2

test/Benchmarks/src/Text/Regex_Bench.enso Outdated Show resolved Hide resolved
@GregoryTravis GregoryTravis added CI: Ready to merge This PR is eligible for automatic merge and removed CI: Ready to merge This PR is eligible for automatic merge labels Nov 8, 2024
<| (build_regexes faker)
<| (build_replacers faker)
<| (Regex.compile "(\d+)")
<| (Regex.compile "(\d+)[a-z]+(\d+)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Och, óóó! That's way nicer! Honestly, up until yesterday I wasn't even aware we support such a nice syntax! I just confused this with @kazcw's multiline constructor definition and then wanted to find a way out without admitting I got confused...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also work without the parens. In an operator block, each operator takes the rest of the line as its RHS.

Copy link
Contributor Author

@GregoryTravis GregoryTravis Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed parens.

@jdunkerley jdunkerley added CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: Keep up to date Automatically update this PR to the latest develop. and removed CI: Clean build required CI runners will be cleaned before and after this PR is built. labels Nov 12, 2024
@jdunkerley jdunkerley removed the CI: Keep up to date Automatically update this PR to the latest develop. label Nov 12, 2024
@GregoryTravis GregoryTravis added the CI: Ready to merge This PR is eligible for automatic merge label Nov 12, 2024
@mergify mergify bot merged commit 978a009 into develop Nov 12, 2024
36 checks passed
@mergify mergify bot deleted the wip/gmt/6200-regex-benches-2 branch November 12, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants